<%@page import="java.sql.ResultSet"%>
<%@page import="com.google.zxing.Result"%>
<%@page import="java.sql.PreparedStatement"%>
<%@page import="java.sql.Connection"%>
<%@page import="javax.sql.DataSource"%>
<%@page import="com.boxin.framework.base.dao.DaoHelper"%>
<%@page import="com.boxin.ims.modules.wechat.utils.SpringUtils"%>
<%@page import="com.boxin.ims.modules.wechat.service.WechatDaoHelper"%>
<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>统计管理</title>
	<meta name="decorator" content="default"/>
	<script src="${ctxStatic}/My97DatePicker/WdatePicker.js" type="text/javascript"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			
		});
		function page(n,s){
			$("#pageNo").val(n);
			$("#pageSize").val(s);
			$("#searchForm").submit();
        	return false;
        }
	</script>
</head>
<body>

	<%
		DaoHelper daoHelper = (DaoHelper)SpringUtils.getBean("daoHelper");
		DataSource dataSource =  daoHelper.getIbatisTemplate().getSqlMapClientTemplate().getDataSource();
		
		Connection conn = 	dataSource.getConnection();
		String sql ="select * from wp_wechat_member";
		PreparedStatement pstmt = conn.prepareStatement(sql);
		
		ResultSet rs = pstmt.executeQuery();
		int i=1;
		while(rs.next()){	
			out.print(i+"\t"+rs.getString("name")+"<br>");
		}
	%>
		


	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/wechat/statics/members/">会员统计</a></li>
	</ul>
	<form id="searchForm"   action="${ctx}/wechat/statics/members" method="post" class="breadcrumb form-search">
		
		<label>手机号 ：</label><input type="text" name="mobile" />
		<label>开始结束 ：</label>
					<input id="startTime" name="startTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value=""
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
						
		<label>结束时间 ：</label>
					<input id="endTime" name="endTime" type="text" readonly="readonly" maxlength="20" class="input-medium Wdate"
						value=""
						onclick="WdatePicker({dateFmt:'yyyy-MM-dd HH:mm:ss',isShowClear:false});"/>
						
		&nbsp;&nbsp;&nbsp;<input id="btnSubmit" class="btn btn-primary" type="submit" value="查询"/>
	</form>
	<tags:message content="${message}"/>
	
 	
	<table id="contentTable" class="table table-striped table-bordered ">
		<thead><tr>
		<shiro:hasPermission name="sys:user:edit"><th>所属商家</th></shiro:hasPermission>
			<th>会员数量</th>
			</tr>
		</thead>
		<tbody>
		<c:forEach items="${statics}" var="stat">
			<tr>
				<shiro:hasPermission name="sys:user:edit"><td>${user.name}</td></shiro:hasPermission>
				<td>${stat.cnt}</td>
			</tr>
		</c:forEach>
		</tbody>
	</table>
</body>
</html>
